package com.example.awa;

public class MyClass {
    public static void main(String[] args) {
        // 创建一只绿头鸭
        Duck mallardDuck = new MallardDuck();
        // 展示绿头鸭外观
        mallardDuck.display();
        // 执行绿头鸭的飞行行为
        mallardDuck.performFly();
        // 执行绿头鸭的呱呱叫行为
        mallardDuck.performQuack();

        // 创建一只橡皮鸭
        Duck rubberDuck = new RubberDuck();
        rubberDuck.display();
        rubberDuck.performFly();
        rubberDuck.performQuack();
    }
}

